﻿using System;
using System.Collections.Generic;
using System.Text;
using BaBaoFan.Modifier.Data;
using BaBaoFan.Modifier.Model;

namespace BaBaoFan.Modifier.Service
{
    public class AlgorithmService : IAlgorithmService
    {
        private readonly IAlgorithmRepository _algorithmRepository;
        public AlgorithmService(IAlgorithmRepository algorithmRepository)
        {
            _algorithmRepository = algorithmRepository;
        }
        public bool Add(CoinAlgorithm algorithm)
        {
            return _algorithmRepository.Add(algorithm);
        }

        public bool Delete(int[] ids)
        {
            return _algorithmRepository.Delete(ids);
        }

        public IEnumerable<AlgorithmUnit> GetAlgorithmUnits()
        {
            return _algorithmRepository.GetAlgorithmUnits();
        }

        public CoinAlgorithm GetCoinAlgorithmById(int id)
        {
            return _algorithmRepository.GetCoinAlgorithmById(id);
        }

        public IEnumerable<CoinAlgorithm> GetCoinAlgorithms()
        {
            return _algorithmRepository.GetCoinAlgorithms();
        }
        public bool Update(CoinAlgorithm algorithm)
        {
            return _algorithmRepository.Update(algorithm);
        }
    }
}
